package de.sisoft.gcjack.communication;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import de.sisoft.gcjack.model.GeoCache;
import de.sisoft.gcjack.model.User;

public class RequestBuilder {

	public List<NameValuePair> buildGeocacheDetailsRequest(GeoCache geocache) {

		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("gccode", geocache.getGcCode()));
		return params;
	}

	public List<NameValuePair> buildGeocacheVotingsRequest(GeoCache geocache, User user) {

		List<NameValuePair> params = new ArrayList<NameValuePair>();

		params.add(new BasicNameValuePair(Constants.TAG_COORDQUALITY, String.valueOf(geocache.getVotedCoordQuality())));
		params.add(new BasicNameValuePair(Constants.TAG_CREATIVITY, String.valueOf(geocache.getVotedCreativity())));
		params.add(new BasicNameValuePair(Constants.TAG_GCCODE, geocache.getGcCode()));
		params.add(new BasicNameValuePair(Constants.TAG_GCDIFFICULTY, String.valueOf(geocache.getVotedDifficulty())));
		params.add(new BasicNameValuePair(Constants.TAG_GCTERRAIN, String.valueOf(geocache.getVotedTerrain())));
		params.add(new BasicNameValuePair(Constants.TAG_USERID, String.valueOf(user.getId())));
		params.add(new BasicNameValuePair(Constants.TAG_WOWFACTOR, String.valueOf(geocache.getVotedWOW())));
		params.add(new BasicNameValuePair(Constants.TAG_RECOMMENDATION, String.valueOf(geocache
				.getVotedRecommendation())));
		return params;
	}

}
